package com.smzd.framework.system.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.smzd.core.dao.AbstractDao;
import com.smzd.core.mappers.IMapper;
import com.smzd.framework.system.domain.Menu;
import com.smzd.framework.system.mappers.MenuMapper;

@Component
public class MenuDao extends AbstractDao<Menu> {
    @Autowired
    private MenuMapper mapper;

    @Override
    protected IMapper<Menu> getMapper() {
        return mapper;
    }

    public List<Menu> getMenusByUserId(int userId) {
        List<Menu> menus = mapper.getMenusByUserId(userId);
        return menus;
    }

    public void updateMenuPosition(Menu elem) {
        mapper.updateMenuPosition(elem);
    }

    public List<Menu> getMenusByMeetingId(int meetingId) {
        List<Menu> menus = mapper.getMenusByMeetingId(meetingId);
        return menus;
    }

}
